package com.qf.map;

import java.util.Hashtable;
import java.util.Map.Entry;
import java.util.Set;

import com.qf.set.Book;

public class HashTableTest {
	
	
	public static void main(String[] args) {
		
		//和HashSet同理，但是既然是倒叙排列？这是正序排列，和数据输入序列一样
		Hashtable<Integer, Book> hashTable = new Hashtable<Integer, Book>();
		
		hashTable.put(1, new Book(101,"《巨人现金》","富勒",59.5));
		hashTable.put(2,new Book(103,"《史记》","司马光",118.2));
		hashTable.put(3,new Book(104,"《原则》","瑞达利欧",68.4));
		hashTable.put(4,new Book(106,"《箐英》","罗伯特·清崎",45.8));
		hashTable.put(5,new Book(105,"《价值》","张磊",125.8));
		hashTable.put(6,new Book(102,"《Java进阶》","马士兵",15.5));
		//这里不要new，否则就是空数据
		Set<Entry<Integer,Book>> entrySet = hashTable.entrySet();
		
		for(Entry<Integer,Book> e : entrySet) {
			
			System.out.println(e.getKey()+ "  " +e.getValue());
			
		}
		
		
		System.out.println(entrySet);
		
		
	}

}
